import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/Home.vue'

const NatureSite = () => import('@/views/nature-site/index.vue')
const AppleAirpods = () => import('@/views/apple-airpods/index.vue')
const PluginObserver = () => import('@/views/plugin-observer/index.vue')
const AI = () => import('@/views/pplx-ai/index.vue')
// const NotFound = () => import("@/views/404/index.vue");

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/nature-site',
      name: 'NatureSite',
      component: NatureSite
    },
    {
      path: '/apple-airpods',
      name: 'AppleAirpods',
      component: AppleAirpods
    },
    {
      path: '/plugin-observer',
      name: 'PluginObserver',
      component: PluginObserver
    },
    {
      path: '/ai',
      name: 'AI',
      component: AI
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'NotFound',
      component: () => {
        window.location.href = '/404.html'
        return new Promise(() => { })
      }
    },
  ]
})

export default router
